package Month07.day28.test;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class main {
    public static void main(String[] args) {
        HashMap<Student, String> map = new HashMap<>();
        Student student = new Student("小黑",15);
        Student student1 = new Student("小红",10);
        Student student2 = new Student("小明",12);
        map.put(student,"江苏");
        map.put(student1,"江西");
        map.put(student2,"江东");
        Set<Student> students = map.keySet();
        for (Student student3 : students) {
            String s = map.get(student3);
            System.out.println(student3+s);
        }
        System.out.println("==========================================");
        Set<Map.Entry<Student, String>> entries = map.entrySet();
        for (Map.Entry<Student, String> entry : entries) {
            System.out.println(entry.getKey()+entry.getValue());
        }
    }
}
